home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 14 / applic / aesbin.c next >
Encoding:
C/C++ Source or Header  |  1986-05-12  |  1.6 KB  |  103 lines

  1. #include <stdio.h>
  2.  
  3. short   contrl[12],
  4.         intin[128],
  5.         ptsin[128],
  6.         intout[128],
  7.         ptsout[128];
  8.  
  9. short   handle,
  10.         phys_handle,
  11.         wi_handle,
  12.         ap_id,
  13.         chw, chh, cbw, cbh;
  14.  
  15. short   work_in [12],
  16.         work_out[57];
  17.  
  18. short   wiwx[15], witx[15],
  19.         wiwy[15], wity[15],
  20.         wiww[15], witw[15],
  21.         wiwh[15], with[15];
  22.  
  23. short   scrap0, scrap1, scrap2, scrap3;
  24.  
  25. /*
  26. ** Initialization routines
  27. */
  28.  
  29. begin_appl ()
  30. {
  31.     int i;
  32.  
  33.     ap_id = appl_init ();
  34.     for (i=0; i<10; work_in[i++] = 1);
  35.     work_in[10] = 0;
  36.     phys_handle = graf_handle (&chw, &chh, &cbw, &cbh);
  37.     handle = phys_handle;
  38.     v_opnvwk (work_in, &handle, work_out);
  39. }
  40.  
  41. end_appl ()
  42. {
  43.     v_clsvwk (handle);
  44.     appl_exit ();
  45.     term0 ();
  46. }
  47.  
  48. aes (code, i)
  49. int code, i;
  50. {
  51.     static char s[] = "[3][FATAL ERROR:|AES error xx detected][Exit to TOS]";
  52.     if (i==0)
  53.     {
  54.         s[28] = (code % 10) + '0';
  55.         s[27] = (code / 10) + '0';
  56.         err (s);
  57.         end_appl();
  58.     }
  59.     return (i);
  60. }
  61.  
  62. err (s)
  63. char *s[];
  64. {
  65.     return (form_alert (1, s));
  66. }
  67.  
  68. dialog (tree)
  69. int tree;
  70. {
  71.     short x, y, h, w, button;
  72.  
  73.     aes (90, form_center (tree, &x, &y, &w, &h));
  74.     form_dial (0, 340, 190, 20, 20, x, y, w, h);
  75.     aes (92, form_dial (1, 340, 190, 20, 20, x, y, w, h));
  76.     aes (93, objc_draw (tree, 0, 4, x, y, w, h));
  77.     button = form_do (tree, 0);
  78.     aes (94, form_dial (3, 340, 190, 20, 20, x, y, w, h));
  79.     aes (95, form_dial (2, 340, 190, 20, 20, x, y, w, h));
  80.     return (button);
  81. }
  82.  
  83. file (but,path)
  84. short *but;
  85. char path[];
  86. {
  87.     char *ptr, ch;
  88.     int ret;
  89.     char inpath[256], insel[256];
  90.     strcpy (inpath, path);
  91.     strcpy (insel, "");
  92.     ret = fsel_input (inpath, insel, but);
  93.     strcpy (path, inpath);
  94.     ptr = path;
  95.     while (ch = *ptr++)
  96.     {
  97.         if (ch == '*')
  98.             break;
  99.     }
  100.     --ptr;
  101.     strcpy (ptr, insel);
  102. }